{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f61d434a",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "def step1(v):\n",
    "    text=\"\".join([w for w in v if w not in whitespace + punctuation + zh_punctuation])\n",
    "    return text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "b328ffc0",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'新办99融合套餐天翼看家七天全天云回看9元乡镇版全屋wifi月租包套餐30元融合联合促销每月优惠30元12个月加10G流量促销10元月36个月加10G流量促销优惠10元月36个月300兆光纤IPTV2张手机卡每月共送600分钟通话40G流量首次办理预存话费200元一次性到账手机卡串89860322249100097578986032224910009758摄像头串码182504000119998路由器串码183229189656900地址武功县南仁乡仁南社区GF001办理联系电话19929172420'"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from string import whitespace, punctuation\n",
    "from zhon.hanzi import punctuation as zh_punctuation\n",
    "\n",
    "step1(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5daa811e",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_json(\"1.json\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "ed59576b",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'办理5G融合99元档，含2张卡，通话600分钟，流量30个G，加天翼看家9元包，加202006融合联合促销优惠30元，做7天云回看乡镇版\\n天翼看家串码，181695448553658\\n8986032124910541210\\n8986032124910541211\\n装机地址永寿豆家镇良村6分纤箱杨讨论门前'"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s0=df.sample(1)\n",
    "s=s0['remarks'].values.tolist()[0]\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "fa69683d",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>order_code</th>\n",
       "      <th>customer_num</th>\n",
       "      <th>start_time</th>\n",
       "      <th>seller_name</th>\n",
       "      <th>seller_phone</th>\n",
       "      <th>cost_info</th>\n",
       "      <th>remarks</th>\n",
       "      <th>task_id</th>\n",
       "      <th>create_time</th>\n",
       "      <th>...</th>\n",
       "      <th>order_state</th>\n",
       "      <th>package_name</th>\n",
       "      <th>cost_special</th>\n",
       "      <th>business_type</th>\n",
       "      <th>rpa_number</th>\n",
       "      <th>update_time</th>\n",
       "      <th>phone</th>\n",
       "      <th>order_data</th>\n",
       "      <th>if_rap</th>\n",
       "      <th>accept_hall</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>277</th>\n",
       "      <td>602</td>\n",
       "      <td>8231295</td>\n",
       "      <td>291069866514</td>\n",
       "      <td>2022-04-26 17:17:42</td>\n",
       "      <td>千库存[9100090059]</td>\n",
       "      <td>19916208826</td>\n",
       "      <td>100.00</td>\n",
       "      <td>办理5G融合99元档，含2张卡，通话600分钟，流量30个G，加天翼看家9元包，加20200...</td>\n",
       "      <td>133125297</td>\n",
       "      <td>2022-04-26 17:01:34.830934</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>['5G畅享融合套餐99元档', '202005光网宽带套餐300M', '201912天翼...</td>\n",
       "      <td>全免</td>\n",
       "      <td>天翼看家</td>\n",
       "      <td>刘旭东</td>\n",
       "      <td>2022-04-26 18:31:08.214408</td>\n",
       "      <td></td>\n",
       "      <td>{\"ACCEPT_ORDER_ID\": 8231295, \"TASK_ID\": \"13312...</td>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      id order_code  customer_num          start_time      seller_name  \\\n",
       "277  602    8231295  291069866514 2022-04-26 17:17:42  千库存[9100090059]   \n",
       "\n",
       "    seller_phone cost_info                                            remarks  \\\n",
       "277  19916208826    100.00  办理5G融合99元档，含2张卡，通话600分钟，流量30个G，加天翼看家9元包，加20200...   \n",
       "\n",
       "       task_id                create_time  ...  order_state  \\\n",
       "277  133125297 2022-04-26 17:01:34.830934  ...            4   \n",
       "\n",
       "                                          package_name  cost_special  \\\n",
       "277  ['5G畅享融合套餐99元档', '202005光网宽带套餐300M', '201912天翼...            全免   \n",
       "\n",
       "    business_type rpa_number                update_time phone  \\\n",
       "277          天翼看家        刘旭东 2022-04-26 18:31:08.214408         \n",
       "\n",
       "                                            order_data if_rap accept_hall  \n",
       "277  {\"ACCEPT_ORDER_ID\": 8231295, \"TASK_ID\": \"13312...      0              \n",
       "\n",
       "[1 rows x 22 columns]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "7240a2bf",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['智家产品新装', '多笔业务', '多类型业务', '移机', '单宽带', '智家产品', '套餐注销', '补卡', '融合', '全屋wifi月租包', '全屋wifi加装', '过户', '改套餐明细', '单卡', '套餐互转', '天翼看家新装', '套餐停机', '天翼看家', '叠加包订购']\n"
     ]
    }
   ],
   "source": [
    "business_type = set(df[\"business_type\"])\n",
    "print(list(business_type)[1:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "3853eab1",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "ee14142e",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "\n",
    "def step1(v):\n",
    "    text=\"\".join([w for w in v if w not in whitespace + punctuation + zh_punctuation])\n",
    "    return text\n",
    "\n",
    "def clean_number(text):\n",
    "    p=re.sub('\\d+','<num>',text)\n",
    "    return p\n",
    "\n",
    "def chinese_tok(text):\n",
    "    s=clean_number(step1(text))\n",
    "    jieba.suggest_freq('副卡',True)\n",
    "    jieba.suggest_freq('补卡',True)\n",
    "    jieba.suggest_freq('主卡',True)\n",
    "    jieba.suggest_freq('G',True)\n",
    "    jieba.suggest_freq('元',True)\n",
    "    jieba.suggest_freq('<num>',True)\n",
    "    jieba.suggest_freq('月租包',True)\n",
    "    dc=[t for t in jieba.cut(s)]\n",
    "    return \" \".join(dc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "525355a5",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'新办 < num > 融合 套餐 天翼 看家 七天 全天 云回 看 < num > 元 乡镇 版 全屋 wifi 月租包 套餐 < num > 元 融合 联合 促销 每月 优惠 < num > 元 < num > 个 月 加 < num > G 流量 促销 < num > 元月 < num > 个 月 加 < num > G 流量 促销 优惠 < num > 元月 < num > 个 月 < num > 兆 光纤 IPTV < num > 张 手机卡 每月 共送 < num > 分钟 通话 < num > G 流量 首次 办理 预存 话费 < num > 元 一次性 到 账 手机卡 串 < num > 摄像头 串码 < num > 路由器 串码 < num > 地址 武功 县南仁 乡仁南 社区 GF < num > 办理 联系电话 < num >'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import re\n",
    "import jieba\n",
    "from sklearn.feature_extraction.text import TfidfVectorizer\n",
    "\n",
    "chinese_tok(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "6feef9c3",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "label_cols=['智家产品新装', '多笔业务', '多类型业务', '移机', '单宽带', '智家产品', '套餐注销', '补卡', '融合', '全屋wifi月租包', '全屋wifi加装', '过户', '改套餐明细', '单卡', '套餐互转', '天翼看家新装', '套餐停机', '天翼看家', '叠加包订购']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "8f853f18",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "def pr(y_i, y):\n",
    "    p = x[y == y_i].sum(0)\n",
    "    return (p + 1) / ((y == y_i).sum() + 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "4500b802",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "import pickle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "0d48adc4",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "with open(f\"save_models/vec.pkl\",'rb') as file:\n",
    "    vec=pickle.load(file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "f761ae09",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.09185353, 0.        , 0.17861457, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.12707311, 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.15502174, 0.        , 0.        , 0.17078263,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.18521258, 0.        , 0.        , 0.12236753, 0.        ,\n",
       "        0.        , 0.14254144, 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.17983302, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.21644072, 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.34538146, 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.22667153,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.17472005,\n",
       "        0.        , 0.14104638, 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.08558101,\n",
       "        0.        , 0.        , 0.        , 0.18064896, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.08696183, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.12403856, 0.        , 0.14705758, 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.35377412, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.08428828, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.14772285, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.13927086, 0.        ,\n",
       "        0.        , 0.28064859, 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.19591773, 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.10914227, 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.14235069, 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.09892454, 0.        , 0.        , 0.        , 0.10120231,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.1420514 ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.10693339, 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.10625025, 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.09625454,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        , 0.09013839, 0.        , 0.        , 0.        ,\n",
       "        0.18107356, 0.        , 0.        , 0.        , 0.        ,\n",
       "        0.        ]])"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vec.transform([chinese_tok(s)]).toarray()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "373361e8",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "sv=vec.transform([chinese_tok(s)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "2057a58b",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sv.shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "fc851141",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "preds = np.zeros((sv.shape[0], len(label_cols)))\n",
    "\n",
    "for i, j in enumerate(label_cols):\n",
    "    with open(f\"save_models/{j}.pkl\",'rb') as file:\n",
    "        m,r=pickle.load(file)\n",
    "\n",
    "    preds[:, i] = m.predict_proba(sv.multiply(r))[:, 1]\n",
    "    \n",
    "    \n",
    "\n",
    "out=pd.DataFrame(preds)\n",
    "out.columns=label_cols"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "2abe00b9",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>智家产品新装</th>\n",
       "      <th>多笔业务</th>\n",
       "      <th>多类型业务</th>\n",
       "      <th>移机</th>\n",
       "      <th>单宽带</th>\n",
       "      <th>智家产品</th>\n",
       "      <th>套餐注销</th>\n",
       "      <th>补卡</th>\n",
       "      <th>融合</th>\n",
       "      <th>全屋wifi月租包</th>\n",
       "      <th>全屋wifi加装</th>\n",
       "      <th>过户</th>\n",
       "      <th>改套餐明细</th>\n",
       "      <th>单卡</th>\n",
       "      <th>套餐互转</th>\n",
       "      <th>天翼看家新装</th>\n",
       "      <th>套餐停机</th>\n",
       "      <th>天翼看家</th>\n",
       "      <th>叠加包订购</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.000475</td>\n",
       "      <td>0.001928</td>\n",
       "      <td>0.014036</td>\n",
       "      <td>0.02116</td>\n",
       "      <td>0.000081</td>\n",
       "      <td>0.634297</td>\n",
       "      <td>0.002418</td>\n",
       "      <td>0.000003</td>\n",
       "      <td>0.213473</td>\n",
       "      <td>0.003687</td>\n",
       "      <td>0.005469</td>\n",
       "      <td>0.001537</td>\n",
       "      <td>0.000159</td>\n",
       "      <td>0.001618</td>\n",
       "      <td>0.014949</td>\n",
       "      <td>0.00107</td>\n",
       "      <td>0.000106</td>\n",
       "      <td>0.151154</td>\n",
       "      <td>0.001122</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     智家产品新装      多笔业务     多类型业务       移机       单宽带      智家产品      套餐注销  \\\n",
       "0  0.000475  0.001928  0.014036  0.02116  0.000081  0.634297  0.002418   \n",
       "\n",
       "         补卡        融合  全屋wifi月租包  全屋wifi加装        过户     改套餐明细        单卡  \\\n",
       "0  0.000003  0.213473   0.003687  0.005469  0.001537  0.000159  0.001618   \n",
       "\n",
       "       套餐互转   天翼看家新装      套餐停机      天翼看家     叠加包订购  \n",
       "0  0.014949  0.00107  0.000106  0.151154  0.001122  "
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "4e44e3b5",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'智家产品'"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "out.idxmax(axis=1).values.tolist()[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7482993e",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}